(function ($) {
    window.toolBackFill = {
        pageDataToString: function (selector, context, attr) {
            if (selector == undefined) {
                selector = "*"
            }
            if (context == undefined) {
                context = 'body';
            }
            if (attr == undefined) {
                attr = 'id'
            }
            var result = [];
            $(selector, context).each(function () {
                var v = $(this).val();
                if (v == null || v == undefined || $.trim(v) == ""){
                    return true;
                }
                result.push("" + $(this).attr(attr) + "=" + $(this).val());
            });
            return result.join(",");
        },
        arrStringToJson:function (s){
            var d = {};
            if (s == null || s == undefined || s == "")
            {
                return d;
            }
            var arr = s.split(",");
            var t;
            for (var i in arr){
                t = arr[i].split("=");
                d[t[0]] = t[1];
            }
            return d;
        }
    }
})(jQuery);